function HandleUser(gui, user, date, options, message) {
  this._gui = gui;
  this._user = user;
  this._date = date;
  this._options = options;
  this._message = message;
  
  this._createElements();
};

HandleUser.prototype._createElements = function() {
  MClientUtils.countIt(new RequestUtils());
  
  //Preset
  var types = UserType.array();
  for (var i = 0, il = types.length; i < il; i++) {
    var tmp = types[i];
    this._gui.type.appendChild(new Option(tmp));
  }
  //Object
  var user = (this._message[0] && this._message[0].data[0]) ? this._message[0].data[0] : pz_user.instance();
  if (!user.id && user.type == '') {
    user.type = types[0];
  }
  if (user.id) {
    this._gui.account.disabled = true;
  }
  
  this._gui.nav.style.display = 'table';
  
  var tr, td;
  tr = this._gui.nav.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.cursor = 'pointer';
  td.style.width = '31px';
  var img = document.createElement('img');
  img.src = 'image/nav/home.png';
  td.onclick = function() { location.href = '?t=clients'; };
  td.appendChild(img);
  
  td.style.padding = '0 0 0 10px';
  td = tr.insertCell(-1);
  td.style.padding = '1px 0 0 0';
  td.style.width = '20px';
  var img = document.createElement('img');
  img.src = 'image/nav/split.png';
  td.appendChild(img);
  
  td = tr.insertCell(-1);
  td.style.cursor = 'pointer';
  td.style.width = '60px';
  td.style.fontWeight = 'bold';
  td.onclick = function() { location.href = '?t=users'; };
  td.appendChild(document.createTextNode('All Users'));
  
  td = tr.insertCell(-1);
  td.style.padding = '1px 0 0 0';
  td.style.width = '20px';
  var img = document.createElement('img');
  img.src = 'image/nav/split.png';
  td.appendChild(img);
  
  td = tr.insertCell(-1);
  td.appendChild(document.createTextNode((user.id) ? 'User ' + user.account : 'New User'));
  
  td = tr.insertCell(-1);
  td.style.textAlign = 'right';
  td.style.cursor = 'pointer';
  td.style.padding = '0 5px 0 0';
  td.style.width = '40px';
  td.style.borderLeft = 'solid 1px #c0c0c0';
  var img = document.createElement('img');
  img.src = 'image/nav/back.png';
  td.onclick = function() { history.back(); };
  td.appendChild(img);
  //Display
  this._gui.account.value = user.account;
  this._gui.password.value = user.password;
  this._gui.email.value = user.email;
  for (var i = 0, il = this._gui.type.options.length; i < il; i++) {
    var tmp = this._gui.type.options[i];
    if (tmp.text == user.type) {
      this._gui.type.selectedIndex = i;
    }
  }
  //Event
  this._gui.account.onchange = function() { user.account = this.value; };
  this._gui.password.onchange = function() { user.password = this.value; };
  this._gui.email.onchange = function() { user.email = this.value; };
  this._gui.type.onchange = function() { user.type = this.options[this.selectedIndex].text; };
  //Submit
  var _self = this;
  this._gui.save.onclick = function() { if (MClientUtils.verifyUser(user, _self._gui) == true) {
                                          new RequestUtils()._write(JSON.stringify([{ n: 'pz_user', a: [user], r: [] }]), function(result, params) { location.href = '?t=users'; }, { pos: DOMUtils.findPos(this) });
                                        }
                                      };
};
